package com.sevntu.apvs.lab3;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

public class OutputData {
	private BufferedWriter outputFileName = null;

	public OutputData(final String fileName) {
		try {
			outputFileName = new BufferedWriter(new FileWriter(
					fileName));
		} catch (IOException e) {
		}
	}

	public void printResult(final List<String> elemSet) {
		try {
			for (int i = 0; i < elemSet.size(); i++) {
				outputFileName.write(elemSet.get(i));
			}
		} catch (IOException e) {

		} finally {
			if (null != outputFileName)
				try {
					outputFileName.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
	}
}
